/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sudoku;

import java.awt.Desktop;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Timer;
import java.util.logging.Level;
import java.util.logging.Logger;
import Modelo.TableroInicial9x9;
import Modelo.SolucionTablero9x9;


public class IniciarNivel9x9V1 implements IController {
    
    private TableroSudoku9x9V1 tab; 
    TableroInicial9x9 tI;
    SolucionTablero9x9 sol= new SolucionTablero9x9();
    TableroController x;
     public static int [][] matriz = new int[9][9]; 
    static Cronometro c;
    
    
    public void process(String model){ 
     //CRONOMETRO QUE CONTROLA LA PARTIDA
   c=new Cronometro();
   c.setLocation(900, 600); 
   c.iniciarCronometro();   
   
     
    if (x.nivel.equals("Nivel 1")){
        
            tI=new TableroInicial9x9(matriz);
            matriz=tI.generarTablero(20);
          
    }else if(x.nivel.equals("Nivel 2")){ 
               
        tI=new TableroInicial9x9(matriz);
        matriz=tI.generarTablero(20);
              
    }else if(x.nivel.equals("Nivel 3")){ 
             
            tI=new TableroInicial9x9(matriz);
            matriz=tI.generarTablero(20);
           
        
    }
    int p=0;
       for (int x=0; x < matriz.length; x++) {
                for (int y=0; y < matriz[0].length; y++) {
                     int z= matriz[x][y];
                     if (z!=0){      
                        tab.text1[p].setEditable(false);
                        tab.text1[p].setText(String.valueOf(matriz[x][y]));                
                     }
                     else{
                         tab.text1[p].setEditable(true);
                        tab.text1[p].setText("");
                     }
                    p++;
                }
       }
    }
       
    
   

     
    public void setView(IView x) {
       this.tab = (TableroSudoku9x9V1) x;             
}
}